package net.zoneland.knowledge.enums;

/**
 * 缓存内容名称定义枚举.
 * @version v1.0
 * @ClassName: CacheEnum
 * @Author: Pbody
 * @Date: 2020年5月1日02:24:36
 */
public enum CacheEnum {
    /**
     * 字典缓存.
     */
    DICT_CACHE_PREFIX("a2:dict", "字典缓存"),
    /**
     * 用户权限缓存.
     */
    USER_ROLE_CACHE("a2:userAuth", "用户权限缓存"),
    /**
     * 用户场景语显示序号.
     */
    ROBOT_WORDS_ORDERS("a2:wordsOrders", "用户场景语显示序号"),
    DATA_CATEGORY("config:dataCategory","数据分类"),
    QUICK_NAV("config:quickNav", "快捷导航");

    private String value;
    private String name;

    private CacheEnum(final String value, final String name) {
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(final String value) {
        for (CacheEnum use : CacheEnum.values()) {
            if (use.value.equals(value)) {
                return use.name;
            }
        }
        return value;
    }

    /**
     * Gets the value of value.
     *
     * @return the value of value
     */
    public String getValue() {
        return value;
    }

    /**
     * Gets the value of name.
     *
     * @return the value of name
     */
    public String getName() {
        return name;
    }
}
